Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
make
require
-ing modules less require-y.
$ npm install --save modmod
Then, change your code from:
var fs = require('fs');
var chalk = require('chalk');
var wiredep = require('wiredep');
fs.writeFile('results.json', wiredep(), function (err) {
if (err) {
console.log(chalk.red.bold(err));
}
});
...to...
var $ = require('modmod')('fs', 'chalk', 'wiredep');
$.fs.writeFile('results.json', $.wiredep(), function (err) {
if (err) {
console.log($.chalk.red.bold(err));
}
});
modmod
is only intended to be used with external (npm-land) modules, and Node's native modules (http
, fs
, etc.). If you would like to namespace your local modules, you are welcome to assign additional objects on top of the object modmod
returns. As an example:
var $ = require('modmod')('fs', 'chalk', 'wiredep');
$.local = {
helpers: require('./helpers'),
utils: require('./utils')
};
modmod
?It's up to you. There's nothing wrong with the current system of multiple var declarations, and having too many isn't a node problem. Regardless, you may still consider it useful to namespace your dependencies under a name of your choosing, such as M
or $
, freeing up those "global" variables for use without conflicts.
MIT © Stephen Sawchuk
FAQs
make require-ing modules less require-y.
The npm package modmod receives a total of 1 weekly downloads. As such, modmod popularity was classified as not popular.
We found that modmod demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.